package com.iseastar.guojiang.cabinet.adapter;

import java.util.ArrayList;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.shouhuobao.station.R;
import com.iseastar.guojiang.model.OrderBean;

import droid.frame.activity.base.BaseAdapterExt;

/***
 * 到柜取件--寄件任务item
 * 
 * @author JinFangXing <br>
 *         2016-9-5下午4:56:17
 */
public class CabinetDeliverTaskAdapter extends BaseAdapterExt<OrderBean> {

	public CabinetDeliverTaskAdapter(ArrayList<OrderBean> items, Activity context) {
		super(items, context);
	}

	private int size;

	public int getSize() {
		return size;
	}

	public void setSize(int size) {
		this.size = size;
	}

	@Override
	public int getCount() {
		return super.getCount() + 10;
	}

	@Override
	public View getView(final int position, View convertView, ViewGroup parent) {
		ViewHolder holder;
		if (convertView == null) {
			holder = new ViewHolder();
			convertView = LayoutInflater.from(context).inflate(R.layout.cabinet_deliver_task_item, parent, false);
			holder.time = (TextView) convertView.findViewById(R.id.cabinet_deliver_task_time);
			holder.number = (TextView) convertView.findViewById(R.id.cabinet_deliver_task_number);
			holder.evaluate = (TextView) convertView.findViewById(R.id.cabinet_deliver_task_evaluate);
			holder.express = (TextView) convertView.findViewById(R.id.cabinet_deliver_task_express);
			holder.img = (ImageView) convertView.findViewById(R.id.cabinet_detail_img);
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}
//		if (items != null) {
//			OrderBean orderBean = items.get(position);
//			if (orderBean != null) {
//				HttpLoader.getInstance().loadImage(orderBean.getSenderPhone(), holder.img, context);
//				holder.time.setText(orderBean.getServiceTimeGe() + "");
//				holder.express.setText(orderBean.getSenderName());
//				holder.number.setText(orderBean.getSenderName() + "");
//				holder.evaluate.setText(orderBean.getAddress());
//			}
//		}
		return convertView;
	}

	private static class ViewHolder {
		TextView time, express, number, evaluate;
		ImageView img;
	}
}
